#include<iostream>
#include<cstring>
using namespace std;
const int N = 110;
int arr[N];
int n;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		memset(arr, 0, sizeof(arr));
		bool flag = 0;
		for (int i = 1; i <= n; i++) {
			cin >> arr[i];
			if (arr[i] == 1)flag = 1;
		}
		for (int i = 2; i <= n; i++) {
			if (arr[i] <= i)flag = 1;
		}
		if (flag) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}